<%--
  Created by IntelliJ IDEA.
  User: 19849
  Date: 2020/10/30
  Time: 14:23
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="${pageContext.request.contextPath}/js/jquery-3.2.1.min.js"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="${pageContext.request.contextPath}/js/bootstrap.min.js"
            integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
    <link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet">

</head>
<body style="background-color: transparent;">
<div class="container">
    <table class="table table-hover table-striped">
        <h3> <label>各省垃圾分类管理条例</label></h3>
        <thead>
        </thead>
        <tbody>
        <%-- 从数据库查询--%>
        <c:forEach var="laws" items="${laws}">
            <tr>
                <td>${laws.l_name}</td>
                <td>
                    <a class="btn btn-info" href="${pageContext.request.contextPath}/toUpd?id=${laws.l_id}">修改</a>
                    &nbsp; | &nbsp;
                    <a class="btn btn-danger"  href="javascript:void(0)" onclick="sc(${laws.l_id})">删除</a>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>

</div>
</div>



<script type="text/javascript">

    function sc(id) {
        if(window.confirm("确认删除吗")){
            document.location="${pageContext.request.contextPath}/delLawsById?l_id="+id
        }
    }
</script>
</body>
</html>
